#ifndef WIDGET_H
#define WIDGET_H

#include <QtOpenGL>
#include <QTime>
#include "QtOpenGLSpriteBatch.h"
#include "SpriteBatchBMFont.h"

class Widget : public QGLWidget
{
    Q_OBJECT
    
public:
    Widget(QWidget *parent = 0);
    ~Widget();

    void resizeGL(int width, int height);
    void initializeGL();
    void destroyGL();
    void paintGL();


protected:
    void renderTextToCenter( const char *text, float xoffset, float y, float size,
                             float angle, float r, float g, float b, float a);

    float renderAngle;
    QTimer *timer;
    QTime prevTime;
    SpriteBatch *spriteBatch;
    SpriteBatchBMFont *font;
};

#endif // WIDGET_H
